﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using IMC.Prepare.Web.Framework.Mvc.Routes;
using System.Web.Routing;
using IMC.Prepare.Web.Framework.Localization;
using System.Web.Mvc;

namespace IMC.Prepare.Web.Infrastructure
{
    public partial class RouteProvider : IRouteProvider
    {
        #region IRouteProvider Members

        public void RegisterRoutes(RouteCollection routes)
        {
            //blog
            routes.MapLocalizedRoute("Blog",
                            "blog",
                            new { controller = "Blog", action = "List" },
                            new[] { "IMC.Prepare.Web.Controllers" });

            routes.MapLocalizedRoute("BlogByTag",
                            "blog/tag/{tag}",
                            new { controller = "Blog", action = "List" },
                            new[] { "IMC.Prepare.Web.Controllers" });

            routes.MapLocalizedRoute("BlogPost",
                            "blog/{blogPostId}/{SeName}",
                            new { controller = "Blog", action = "BlogPost", SeName = UrlParameter.Optional },
                            new { blogPostId = @"\d+" },
                            new[] { "IMC.Prepare.Web.Controllers" });
            routes.MapLocalizedRoute("BlogByMonth",
                            "blog/month/{month}",
                            new { controller = "Blog", action = "List" },
                            new[] { "Nop.Web.Controllers" });






            //customer
            routes.MapLocalizedRoute("CustomerProfile",
                            "profile/{id}",
                            new { controller = "Profile", action = "Index" },
                            new { id = @"\d+" },
                            new[] { "Nop.Web.Controllers" });

            //login, register
            routes.MapLocalizedRoute("Login",
                            "login/",
                            new { controller = "Customer", action = "Login" },
                            new[] { "Nop.Web.Controllers" });

            routes.MapLocalizedRoute("PasswordRecovery",
                            "passwordrecovery",
                            new { controller = "Customer", action = "PasswordRecovery" },
                            new[] { "Nop.Web.Controllers" });
            routes.MapLocalizedRoute("Logout",
                            "logout/",
                            new { controller = "Customer", action = "Logout" },
                            new[] { "Nop.Web.Controllers" });
        }


        public int Priority
        {
            get
            {
                return 0;
            }
        }

        #endregion
    }
}